export function validatenBody(rule, value, callback, data) {
  if (!value) {
    return callback(new Error("请输入具体金额"))
  } else if (!(/^\d+(\.\d{1,2})?$/.test(value))) {
    return callback(new Error("非负数且最多两位小数"));
  } else if (rule.field == "activityGiftCouponList.1.value") {
    if (Number(data[1].value) <= Number(data[0].value)) {
      return callback(new Error("二阶必须大于一阶金额"));
    } else {
      callback();
    }
  } else if (rule.field == "activityGiftCouponList.2.value") {
    if (Number(data[2].value) <= Number(data[1].value)) {
      return callback(new Error("三阶必须大于二阶金额"));
    } else {
      callback();
    }
  } else {
    callback();
  }
}
export function addBody(self) {
  if (self.form1Validate['custom'] && self.form1Validate['denomination'] == 'custom') {
    self.form.activityGiftCouponList[self.voucherIndex]['denomination'] = JSON.parse(JSON.stringify(self.form1Validate['custom']));
  } else {
    self.form.activityGiftCouponList[self.voucherIndex]['denomination'] = JSON.parse(JSON.stringify(self.form1Validate['denomination']));
  }
  self.form.activityGiftCouponList[self.voucherIndex]['useCondition'] = JSON.parse(JSON.stringify(self.form1Validate['useCondition']));
  self.form.activityGiftCouponList[self.voucherIndex]['validityDays'] = JSON.parse(JSON.stringify(self.form1Validate['validityDays']));
  self.form.activityGiftCouponList[self.voucherIndex]['custom'] = JSON.parse(JSON.stringify(self.form1Validate['custom']));
}
export const list = [{
  value: '10',
  label: '10'
}, {
  value: '20',
  label: '20'
}, {
  value: '30',
  label: '30'
}, {
  value: '40',
  label: '40'
}, {
  value: '50',
  label: '50'
}, {
  value: '60',
  label: '60'
}, {
  value: 'custom',
  label: '自定义'
}]
